package com.kaifamiao.thread.d0929;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {

    public static void main(String[] args) {

        try {
            Socket client = new Socket("127.0.0.1", 8889);

            OutputStream outputStream = client.getOutputStream();

            FileInputStream fis = new FileInputStream("C:\\Users\\10854\\Pictures\\cat.jpg");


            fis.transferTo(outputStream);


            outputStream.flush();
            outputStream.close();
//            client.shutdownOutput();


        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
